from tortoise.models import Model
from tortoise import fields

class Repository(Model):
    id = fields.BigIntField(pk=True)
    user_id = fields.BigIntField()
    title = fields.CharField(max_length=64)
    description = fields.CharField(max_length=255, null=True)
    icon = fields.CharField(max_length=255, null=True)
    short_uri = fields.CharField(max_length=64)
    permission = fields.IntField(default=0)
    sort_order = fields.IntField(default=0)
    create_time = fields.DatetimeField(auto_now_add=True, null=True)
    update_time = fields.DatetimeField(auto_now=True, null=True)
    del_flag = fields.BooleanField(default=0, null=True)

    class Meta:
        table = 't_repository'
